﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Services;
using System.Data;
using System.Text;

using SocialIn.Biz;
using SocialIn.Core.Data;


namespace SocialIn.Web.UserControls
{
    public partial class UCVoluntaryActivity : System.Web.UI.UserControl
    {
        private string _helpStatus;
        public string HelpStatus
        {
            get {
                return _helpStatus;
            }
            set
            {
                _helpStatus = value;
            }
        }


        protected void Page_PreRender(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.QueryString["seq"] != null)
                    GetDefaultDataBind(Request.QueryString["seq"].ToString());
                //GetDefaultDataBind("6");

            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
        }



        protected void GetDefaultDataBind(string seq)
        {
            VoluntaryActivity biz = new VoluntaryActivity();
            Result<DataTable> resultVolunteer = biz.GetVoluntaryActivityView(seq);

            if (resultVolunteer.ReturnValue != null && resultVolunteer.ReturnValue.Rows.Count > 0)
            {
                /* A.Seq, A.NgoID, A.Title, A.TalentID, A.Detail, A.WishStartDate, A.WishEndDate, A.ReceiptStartDate, A.ReceiptEndDate
	            , A.Place, A.MapX, A.MapY, A.MapPanoramaID, A.MapPan, A.MapTilt, A.MapZoom, A.Complement
	            , A.PersonInCharge, A.Contact, A.Writer, A.WriteDate
	            , B.NgoName, B.PersonInChargeID, B.PhoneNum
                 * // Complement
                 */
                litTitle.Text = resultVolunteer.ReturnValue.Rows[0]["Title"].ToString();
                litPlace.Text = resultVolunteer.ReturnValue.Rows[0]["Place"].ToString();
                litPhone.Text = resultVolunteer.ReturnValue.Rows[0]["PhoneNum"].ToString();
                litTime.Text = resultVolunteer.ReturnValue.Rows[0]["WishStartDate"].ToString();
                litCount.Text = string.Concat(resultVolunteer.ReturnValue.Rows[0]["Contact"].ToString(), "명");
                _helpStatus = resultVolunteer.ReturnValue.Rows[0]["Complement"].ToString();
            }



        }

    }
}